<ul class="nav" data-bind="foreach: menu">
    <li>
        <a data-bind="attr: { href: '#' + id }, click: $root.scrollTo.bind($root, id), text: label"></a>
        <ul class="nav" data-bind="visible: children, foreach: children">
            <li>
                <a data-bind="attr: { href: '#' + id }, click: $root.scrollTo.bind($root, id), text: label"></a>
            </li>
        </ul>
    </li>
</ul>